﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;

namespace IHISCETeim.Web.MachineSys.UserModel
{
    public partial class UAgentMacStockAdd : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.新增 };
            }
        }
        protected override string DWZRef
        {
            get { return "UAgentMacStockList"; }
        }

        #region
       

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "add")
            {
                addmenu();
                
            }
        }

        protected void addmenu()
        {
            UAgentMacStockInfo obj = Request.SerializableObject<UAgentMacStockInfo>();
            obj.IntoStockDate = Convert.ToDateTime(obj.IntoStockDate).ToString("yyyy-MM-dd");
            obj.AgentName = GetRequestValue<string>("dwz.orgLookup.AgentName","");
            this.AddLog(Permission.新增, obj);
            if (UAgentMacStockController.Add(obj))
                SuccessJson("成功添加样机", "");
            else
                ErrorJson("添加样机失败", "");
        }
    }
}